The BDD Books by Gáspár Nagy

The BDD Books by Gáspár Nagy

Author:Gáspár Nagy
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2019-07-25T16:00:00+00:00


How Many Examples Do We Need?

Let's have a look at the rule that our team discussed in Chapter 2, Structured Conversation:

Figure 3.2: Address change rule

The team were exploring the address change functionality and came to the conclusion that the address can only be changed before an order is picked up by a delivery person. This means that the delivery address can't be changed once an order has progressed beyond the Waiting for pickup state:

Figure 3.3: Order states

You probably remember that there was a misunderstanding between team members during the discussion. Initially, the rule stated that the address could be changed before an order is Waiting for pickup (which means it has not progressed beyond the In preparation state). The team resolved the misunderstanding using concrete examples, but it could still be implemented incorrectly!

Without knowing much about the application, we can imagine that this functionality will be implemented using an if statement that will look something like this:

if (order.State <= OrderState.WaitingForPickup)

...

So, let's imagine that Dave, who developed this feature, uses < instead of <= in this condition. This is the sort of mistake that is easy to make, even though the developer is fully aware of the requirement's details.

The team described two examples for the rule:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.